// pages/news/news.js
var app=getApp();

Page({
  data: {
    _num: 0,
    ischose:0,
    uploadUrl: app.uploadUrl,
    name:'行业新闻',
    news_2: [
      {
        src: "../../img/a_60_03.png",
        title: "我是二我是二我是二我是二我是二我是二我是二我是二我是二",
        mes: "7月1日，是国务院关税税则委员院关税税则委会宣布降低汽车整车及零部件进口关税政策落地实施的首",
        evaluate: "26",
        date: "2018-07-10"
      } 
    ],
    news_3: [
      {
        src: "../../img/a_60_03.png",
        title: "我是三我是三我是三我是三我是三我是三我是三我是三我是三",
        mes: "7月1日，是国务院关税税则委员院关税税则委会宣布降低汽车整车及零部件进口关税政策落地实施的首",
        evaluate: "26",
        date: "2018-07-10"
      }
    ],
  },
  focus_click: function (e) {
    var that = this
    that.setData({
      _num: e.currentTarget.dataset.num,
      ischose: 0
    })
    that.get_news();
  },
  newsDetails:function(e){
    var id = e.currentTarget.dataset.id;
 
    wx.navigateTo({
      url: '../newsDetails/newsDetails?id='+id,
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
  },
  onReady: function () {
  
  },
  onShow: function () {
    var that=this;
    that.get_news();
  },
  get_news(){
    var that = this;
    wx.request({
      url: app.url + '/Article/_list',
      method: 'post',
      data: {
        type: that.data._num,
      },
      success: function (res) {
        if (res) {
          that.setData({
            news: res.data.data
          })
        }
      }

    })
  },
  onHide: function () {
  
  },
  onUnload: function () {
  
  },
  onPullDownRefresh: function () {
  
  },
  onReachBottom: function () {
  
  },
  onShareAppMessage: function () {
  
  }
})